import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import org.springframework.web.util.DefaultUriTemplateHandler;

import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;


/**
 * @author cj-ch
 * @date 2018/1/3 下午4:32
 */
public class wee {
    static ObjectMapper objectMapper = new ObjectMapper();
    public static void main(String[] args) throws JsonProcessingException, UnsupportedEncodingException {
        String h5ctobPageTemplate = "{h5Domain}/app/index.html#/payment/ctob?merchantId={merchantId}&openid={openid}&amount={amount}&websocketId={websocketId}&storeId={storeId}&merchantUserId={merchantUserId}&qrcodeId={qrcodeId}";
        DefaultUriTemplateHandler handler = new DefaultUriTemplateHandler();
        String h5Domian = "http://www.baiduc.om";
        Long merchantId=171L;
        String openid = "sdfdsfdsfd";
        BigDecimal amount = new BigDecimal("0.08");
        String websocketId = null;
        Long storeId=156L;
        Long merchantUserId=12345L;
        Long qrcodeId=null;
        String h5ctobPageUrl = handler.expand(
                h5ctobPageTemplate,
                h5Domian,
                merchantId,
                openid,
                amount,
                websocketId,
                storeId,
                null,
                qrcodeId
        ).toString();
        System.out.println(h5ctobPageUrl);
    }

    @Data
    static class A{
        private Long s;
    }

}
